﻿<p>Before Text</p>

@{
    if (DateTime.Now.ToBinary() % 2 == 0) @("Current time is divisible by 2") else @DateTime.Now

    object Bar()
    {
        if (DateTime.Now.ToBinary() % 2 == 0)
            return "Current time is divisible by 2";
        else if (DateTime.Now.ToBinary() % 3 == 0)
            return "Current time is divisible by 3";
        else
            return DateTime.Now;
    }

    for (var i = 0; i < 10; i++)
        // Incrementing a number
        i--;

    @foreach (var item in new[] {"hello"})
        @item

    do
        @currentCount
    while (--currentCount >= 0);

    while (--currentCount <= 10)
        currentCount++;

    using (var reader = new System.IO.StreamReader("/something"))
        @reader.ReadToEnd()

    @lock (this)
        currentCount++;
}

@functions {
    public string Foo()
    {
        var x = "";

        if (DateTime.Now.ToBinary() % 2 == 0)
            return "Current time is divisible by 2";
        else
            return "It isn't divisible by two";
        
        for (var i = 0; i < 10; i++)
            // Incrementing a number
            i--;

        foreach (var item in new[] {"hello"})
            @item

        do
            @currentCount
        while (--currentCount >= 0);

        while (--currentCount <= 10)
            currentCount++;

        using (var reader = new System.IO.StreamReader("/something"))
            @reader.ReadToEnd()

        lock (this)
            currentCount++;
    }

    int currentCount = 0;

    public void IncrementCount()
    {
        if (true) currentCount++;
    }

}

@for (var i = 0; i < 10; i++)
    @i

@foreach (var item in new[] {"hello"})
    @item

@do
    @currentCount
while (--currentCount >= 0);

@while (--currentCount <= 10)
    currentCount++;

@using (var reader = new System.IO.StreamReader("/something"))
    // Reading the entire file
    @reader.ReadToEnd()

@lock (this)
    currentCount++;

@if (true) @@GitHubUserName <p>Hello!</p>

@if (true) 
    @: <p>The time is @DateTime.Now</p>

<p>After Text</p>